package com.mt.common.system.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.DateSerializer;
import com.mt.common.core.annotation.DColumn;
import com.mt.common.core.annotation.DEntity;
import com.mt.common.core.web.base.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.io.Serializable;
import java.util.Date;

@DEntity(label="定时任务记录",comment="",moduleLabel="定时任务")
@Entity(name="system_scheduled_task_log")
@Table(name = "system_scheduled_task_log" , indexes = {   })
@ApiModel(description = "定时任务记录:")
public class ScheduledTaskLog extends BaseEntity implements Serializable{
	private static final long serialVersionUID = 1L;

	@DColumn(index=3,label="任务名称",comment="定时任务名称",component="文本",where=true)
	@ApiModelProperty(value = "任务名称:定时任务名称")
	@Column(name="job_name",length=255,nullable=true,unique=false)
	private String jobName;

	@DColumn(index=4,label="任务分组",comment="定时任务分组",component="文本",where=true)
	@ApiModelProperty(value = "任务分组:定时任务分组")
	@Column(name="job_group",length=255,nullable=false,unique=false)
	private String jobGroup;

	@DColumn(index=5,label="cron表达式",comment="cron表达式",component="文本",where=false)
	@ApiModelProperty(value = "cron表达式:cron表达式")
	@Column(name="cron",length=255,nullable=true,unique=false)
	private String cron;

	@DColumn(index=6,label="接口Bean",comment="需要调用接口的beanName",component="文本",where=true)
	@ApiModelProperty(value = "接口Bean:需要调用接口的beanName")
	@Column(name="bean_name",length=255,nullable=true,unique=false)
	private String beanName;

	@DColumn(index=7,label="方法",comment="需要调用的bean方法",component="文本",where=false)
	@ApiModelProperty(value = "方法:需要调用的bean方法")
	@Column(name="method_name",length=255,nullable=true,unique=false)
	private String methodName;

	@DColumn(index=8,label="方法参数",comment="方法参数，json字符串存储",component="文本",where=false)
	@ApiModelProperty(value = "方法参数:方法参数，json字符串存储")
	@Column(name="method_params",length=255,nullable=true,unique=false)
	private String methodParams;

	@DColumn(index=9,label="执行结果",comment="定时任务执行结果",component="文本",where=false)
	@ApiModelProperty(value = "执行结果:定时任务执行结果")
	@Column(name="result",length=255,nullable=true,unique=false)
	private String result;

	@DColumn(index=10,label="执行开始时间",comment="开始执行时间",component="日期选择",where=false)
	@ApiModelProperty(value = "执行开始时间:开始执行时间")
	@Column(name="start_time",length=255,nullable=true,unique=false)
	@JsonSerialize(using = DateSerializer.class)
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	private Date startTime;

	@DColumn(index=11,label="执行结束时间",comment="结束执行时间",component="日期选择",where=false)
	@ApiModelProperty(value = "执行结束时间:结束执行时间")
	@Column(name="end_time",length=255,nullable=true,unique=false)
	@JsonSerialize(using = DateSerializer.class)
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	private Date endTime;

	@DColumn(index=12,label="失败原因",comment="失败原因",component="文本",where=false)
	@ApiModelProperty(value = "失败原因:失败原因")
	@Column(name="fail_reason",length=255,nullable=true,unique=false)
	private String failReason;


	public String getJobName() {
		return this.jobName;
	}

	public void setJobName(String jobName) {
		this.jobName = jobName;
	}

	public String getJobGroup() {
		return this.jobGroup;
	}

	public void setJobGroup(String jobGroup) {
		this.jobGroup = jobGroup;
	}

	public String getCron() {
		return this.cron;
	}

	public void setCron(String cron) {
		this.cron = cron;
	}

	public String getBeanName() {
		return this.beanName;
	}

	public void setBeanName(String beanName) {
		this.beanName = beanName;
	}

	public String getMethodName() {
		return this.methodName;
	}

	public void setMethodName(String methodName) {
		this.methodName = methodName;
	}

	public String getMethodParams() {
		return this.methodParams;
	}

	public void setMethodParams(String methodParams) {
		this.methodParams = methodParams;
	}

	public String getResult() {
		return this.result;
	}

	public void setResult(String result) {
		this.result = result;
	}

	public Date getStartTime() {
		return this.startTime;
	}

	public void setStartTime(Date startTime) {
		this.startTime = startTime;
	}

	public Date getEndTime() {
		return this.endTime;
	}

	public void setEndTime(Date endTime) {
		this.endTime = endTime;
	}

	public String getFailReason() {
		return this.failReason;
	}

	public void setFailReason(String failReason) {
		this.failReason = failReason;
	}



}
